

**********************************************************************************
* Appendix File for "When Parents Decide: Gender Differences in Competitiveness" *
* Created by Jonas Tungodden and Alexander Willen				 *
* Last Edited July 11, 2022							 * 
**********************************************************************************

**********************************************************************************
* Opening the log file and choosing settings
version 16
set scheme s2mono
set more off
global Data "/data/prosjekt/competitive_gender"
global Results "/home/alexander/Whenparentsdecide/"
set cd "$Results/"
log using "$Results/Appendix.smcl", replace
**********************************************************************************


************
************
** TABLES **
************
************

*********************
* Appendix Table A1 * 
*********************

use "$Data/experimentdata", clear   

*Panel A
reg cchoice boy girl, nocons
reg optimal_tournament_entry boy girl, nocons
reg ccertainty boy girl, nocons
reg ccomp_q boy girl, nocons

reg points3 boy girl, nocons
reg cbskill boy girl, nocons

reg crisk boy girl, nocons
reg crisk_q boy girl, nocons

reg cbchoicem boy girl, nocons
reg cbchoiced boy girl, nocons

reg ccomp_s boy girl, nocons
reg csuc boy girl, nocons
reg cdisc_p boy girl, nocons

*Panel B
reg pchoice boy girl, nocons
reg pchoice boy girl if mother==1, nocons
reg pchoice boy girl if father==1, nocons

reg pself boy girl, nocons
reg pself boy girl if mother==1, nocons
reg pself boy girl if father==1, nocons

reg pbelief boy girl, nocons
reg pbskill boy girl, nocons

reg prisk boy girl, nocons
reg prisk_q boy girl, nocons

reg pcomp_s boy girl, nocons
reg psuc_h boy girl, nocons
reg pdisc_p boy girl, nocons

*********************
* Appendix Table A2 * 
*********************
{
use "$Data/experimentdata_incomplete_obs"	
preserve
eststo clear 
eststo: reg points3 rando_selected_comp_r2, r    
eststo: reg points2 rando_selected_comp_r2, r
esttab using "$Results/T_A2.csv", replace label nonumber b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
restore
}

*********************
* Appendix Table A3 * 
*********************
{
use "$Data/experimentdata", clear   

eststo clear
   eststo:  reg points1 girl if child==1, r
   eststo:  reg points2 girl if child==1, r
   eststo:  reg points3 girl if child==1, r
esttab using "$Results/T_A3.csv", replace label nonumber keep(girl) b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
}  

*********************
* Appendix Table A4 *  
*********************
{
use "$Data/admindata", clear   

gen g10HS=round(grade10_GPA)
eststo clear
	xi: eststo: reg pchoice girl if child==0, r
	xi: eststo: reg pchoice girl points3 if child==0, r
	xi: eststo: reg pchoice girl i.points3 if child==0, r
	xi: eststo: reg pchoice girl i.points1 i.points2 i.points3 if child==0, r
	xi: eststo: reg pchoice girl i.g10HS i.points1 i.points2 i.points3 if child==0, r
	xi: eststo: reg cchoice girl if child==1, r
	xi: eststo: reg cchoice girl points3 if child==1, r
	xi: eststo: reg cchoice girl i.points3 if child==1, r
	xi: eststo: reg cchoice girl i.points1 i.points2 i.points3 if child==1, r
	xi: eststo: reg cchoice girl i.g10HS i.points1 i.points2 i.points3 if child==1, r
esttab using "$Results/T_A4.csv", replace label nonumber keep(girl) b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
}

*********************
* Appendix Table A5 * 
*********************
{
use "$Data/admindata", clear   

eststo clear
xi: eststo: reg pchoice girl i.pbskill i.points3 i.prisk i.prisk_q i.g10HS if child==0, r
xi: eststo: reg pchoice girl i.pbskill i.points3 i.prisk i.prisk_q i.g10HS parentalincome pcollege mother if child==0, r
xi: eststo: reg cchoice girl i.cbskill i.points3 i.crisk i.crisk_q i.g10HS if child==1, r
xi: eststo: reg cchoice girl i.cbskill i.points3 i.crisk i.crisk_q i.g10HS parentalincome pcollege mother if child==1, r	
esttab using "$Results/T_A5.csv", replace label nonumber b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
}

*********************
* Appendix Table A6 * 
*********************
{
use "$Data/admindata", clear   

sum points3, det
gen HighAb=(points3>r(p50))
sum parentalincome, det
gen HighSES=(parentalincome>r(p50)) & pcollege==1

eststo clear

eststo: reg pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & foreign==1, a(school) robust
eststo: reg pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & foreign==0, a(school) robust
eststo: reg pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & cbrokenh==1, a(school) robust
eststo: reg pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & cbrokenh==0, a(school) robust
eststo: reg pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & HighSES==0, a(school) robust
eststo: reg pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & HighSES==1, a(school) robust
eststo: reg pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & HighAb==0, a(school) robust
eststo: reg pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & HighAb==1, a(school) robust
eststo: reg cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==1 & foreign==1, a(school) robust
eststo: reg cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==1 & foreign==0, a(school) robust
eststo: reg cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==1 & cbrokenh==1, a(school) robust
eststo: reg cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==1 & cbrokenh==0, a(school) robust
eststo: reg cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & HighSES==0, a(school) robust
eststo: reg cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & HighSES==1, a(school) robust
eststo: reg cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & HighAb==0, a(school) robust
eststo: reg cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & HighAb==1, a(school) robust
	
esttab using "$Results/T_A6.csv", replace label nonumber b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)

keep if child==0

mhtreg  (pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & foreign==1) (pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & foreign==0) (pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & cbrokenh==1) (pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & cbrokenh==0) (pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & HighSES==0) (pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & HighSES==1) (pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & HighAb==0) (pchoice girl pbskill points3 prisk prisk_q mother pcollege parentalincome if child==0 & HighAb==1) 

mhtreg  (cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & foreign==1) (cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & foreign==0) (cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & cbrokenh==1) ( cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & cbrokenh==0) (cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & HighSES==0) (cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & HighSES==1) (cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & HighAb==0) (cchoice girl cbskill points3 crisk crisk_q mother pcollege parentalincome if child==0 & HighAb==1) 
	
}

*********************
* Appendix Table A7 * 
*********************
{
use "$Data/experimentdata", clear   

   eststo clear
   sum points3, det // p50 is 5
      
    eststo: reg rearnings parent,  cl(npid)  
    eststo: reg rearnings parent if mother==1 & girl==0, cl(npid) 
    eststo: reg rearnings parent if mother==1 & girl==1, cl(npid) 
    eststo: reg rearnings parent if mother==0 & girl==0, cl(npid) 
    eststo: reg rearnings parent if mother==0 & girl==1, cl(npid) 
    
    eststo: reg rearnings parent if points3>=5,  cl(npid) 
    eststo: reg rearnings parent if points3<5,  cl(npid) 
    eststo: reg rearnings parent if points3>=5 & girl==1, cl(npid)   
    eststo: reg rearnings parent if points3<5 & girl==1,  cl(npid) 
    eststo: reg rearnings parent if points3>=5 & girl==0, cl(npid) 
    eststo: reg rearnings parent if points3<5 & girl==0,  cl(npid)   

esttab using "$Results/T_A7.csv", replace label nonumber  b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)	
}

*********************
* Appendix Table A8 * 
*********************
{
use "$Data/experimentdata", clear   

eststo clear

eststo: reg pchoice points3  prisk prisk_q if girl==0 & child==1, r
eststo: reg pchoice points3  prisk prisk_q if girl==1 & child==1, r
xi: eststo: reg pchoice i.girl*points3 i.girl*prisk i.girl*prisk_q if child==1, r
    
eststo: reg pchoice  pbskill prisk prisk_q if girl==0, r
eststo: reg pchoice  pbskill prisk prisk_q if girl==1, r
xi: eststo: reg pchoice i.girl*pbskill i.girl*prisk i.girl*prisk_q if child==1, r
    
eststo: reg pchoice points3 pbskill prisk prisk_q if girl==0, r
eststo: reg pchoice points3 pbskill prisk prisk_q if girl==1, r
xi: eststo: reg pchoice i.girl*points3 i.girl*pbskill i.girl*prisk i.girl*prisk_q if child==1, r

esttab using "$Results/T_A8.csv", replace label nonumber k b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)	
}

*********************
* Appendix Table A9 * 
*********************
{
use "$Data/experimentdata", clear   

eststo clear
keep if child==1
gen nonbinarybelief = pbcertainty/20
eststo: reg pchoice girl nonbinarybelief, r
eststo: reg pchoice girl nonbinarybelief pself, r
eststo: reg pchoice nonbinarybelief pself if girl==0, r
eststo: reg pchoice nonbinarybelief pself if girl==1, r
esttab using "$Results/T_A9.csv", replace label nonumber keep(girl nonbinarybelief pself) b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
}

**********************
* Appendix Table A10 * 
**********************
{
* 10th grade gpa
{
use "/data/prosjekt/inequality/education/tab_karakter_grunnskole_2002-2019.dta", clear
gen year=substr(avgdato,1,4)
destring year, force replace
keep if year==2006
destring stp, force replace
collapse (mean) stp, by(npid)
ren stp grade10_GPA
save "$Data/T1.dta", replace
}

* Academic track
{
use "/data/prosjekt/inequality/education/tab_vitnemal_vgskole_2001-2017.dta", clear
destring studretn_1, force replace
gen academic_Y1=studretn_1<70
gen studspec_Y1=studretn_1==62
tostring utdato, replace
gen yearHSgrad=substr(utdato,1,4)
destring yearHSgrad, force replace
duplicates drop npid, force
keep npid yearHSgrad academic_Y1 studspec_Y1
save "$Data/T2.dta", replace
}

* College 
{
use "/data/prosjekt/inequality/education/bu_igang_1980-2019.dta", clear
keep if year==2019
keep npid bu
drop if bu==999999

ren bu nus2000

collapse (max) nus2000, by(npid)
gen college=(nus2000>600000)

tostring nus2000, force replace
gen edlvl=substr(nus2000,1,2)
destring edlvl, force replace
gen STEM=(edlvl==65 | edlvl==75 | edlvl==85)

keep npid college STEM
save "$Data/T3.dta", replace
}

* Merging
{
use "$Data/T1.dta", clear
merge 1:1 npid using "$Data/T2.dta"
drop if _merge==2
drop _merge
merge 1:1 npid using "$Data/T3.dta"
drop if _merge==2
drop _merge
}

* Getting statistics
{
bysort studspec_Y1: sum grade10_GPA college pearn STEM
}	
}

**********************
* Appendix Table A11 * 
**********************
{
use "$Data/admindata", clear   

eststo clear
xi: areg sspec_Y1_imp i.pchoice*i.cchoice girl if child==0 & oneparincmissing!=1 & pcollege!=.,  a(school) r
xi: areg sspec_Y1_imp i.pchoice*i.cchoice girl mother pcollege parentalincome if child==0 & oneparincmissing!=1 & pcollege!=.,  a(school) r
esttab using "$Results/T_A11.csv", replace label nonumber b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)	
}

**********************
* Appendix Table A12 * 
**********************
{
use "$Data/admindata", clear   

eststo clear

eststo: areg sspec_Y1_imp pchoice grade10_GPA 	girl								if child==0 & oneparincmissing!=1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice grade10_GPA 	girl							if child==0 & oneparincmissing!=1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice girl mother pcollege parentalincome grade10_GPA 	girl		if child==0 & oneparincmissing!=1 & pcollege!=., a(school) robust

esttab using "$Results/T_A12.csv", replace label nonumber keep(cchoice pchoice grade10_GPA) r2 b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
}

**********************
* Appendix Table A13 * 
**********************
{
use "$Data/admindata", clear   

eststo clear

preserve 
use "/data/prosjekt/competitive_gender/karakter_vgs.dta", clear
destring stp, force replace
collapse (mean) stp, by(npid)
ren stp vgs_GPA
save "$Results/data/temp.dta", replace
restore

merge m:1 npid using "$Results/data/temp.dta"		// parent and child get the same values
drop if _merge==2
drop _merge

reg vgs_GPA pchoice girl 								if child==0 & oneparincmissing!=1 & pcollege!=., a(school) robust
reg vgs_GPA pchoice girl pcollege parentalincome mother					if child==0 & oneparincmissing!=1 & pcollege!=., a(school) robust
reg vgs_GPA pchoice pcollege parentalincome mother					if child==0 & oneparincmissing!=1 & pcollege!=. & girl==1, a(school) robust
reg vgs_GPA pchoice pcollege parentalincome mother					if child==0 & oneparincmissing!=1 & pcollege!=. & girl!=1, a(school) robust 

reg dropout pchoice girl 								if child==0 & oneparincmissing!=1 & pcollege!=., a(school) robust
reg dropout pchoice girl pcollege parentalincome mother					if child==0 & oneparincmissing!=1 & pcollege!=., a(school) robust
reg dropout pchoice pcollege parentalincome mother					if child==0 & oneparincmissing!=1 & pcollege!=. & girl==1, a(school) robust 
reg dropout pchoice pcollege parentalincome mother					if child==0 & oneparincmissing!=1 & pcollege!=. & girl!=1, a(school) robust 
esttab using "$Results/T_A13.csv", replace label nonumber keep(pchoice) r2 b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
}

**********************
* Appendix Table A14 * 
**********************
{
use "$Data/admindata", clear   

eststo clear

gen GPAr=round(grade10_GPA)
sum grade10_GPA, det
gen vLow=(grade10_GPA<=r(p10))
gen Low=(grade10_GPA<=r(p25))
gen High=(grade10_GPA>=r(p75))
gen vHigh=(grade10_GPA>=r(p90))
gen HighMid=(grade10_GPA>r(p50))

eststo: areg sspec_Y1_imp pchoice cchoice girl pcollege parentalincome if child==0 & oneparincmissing!=1 & vLow==1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice girl pcollege parentalincome if child==0 & oneparincmissing!=1 & Low==1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice girl pcollege parentalincome if child==0 & oneparincmissing!=1 & High==1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice girl pcollege parentalincome if child==0 & oneparincmissing!=1 & vHigh==1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice girl pcollege parentalincome if child==0 & oneparincmissing!=1 & HighMid==1 & pcollege!=., a(school) robust
esttab using "$Results/T_A14.csv", replace ///
	label nonumber keep(pchoice cchoice) r2 b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
}

**********************
* Appendix Table A15 * 
**********************
{
use "$Data/admindata", clear   

eststo clear
keep if child==0
eststo: reg pchoice pbelief pself if mother==1 & invited_mother==mother, r
eststo: reg pchoice pbelief pself if mother==0 & invited_mother==mother, r

esttab using "$Results/T_A15.csv", replace label nonumber  b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
}

**********************
* Appendix Table A16 *
********************** 
{
use "$Data/admindata", clear   

keep if invited_mother==mother 
eststo clear

eststo: areg sspec_Y1_imp pchoice girl 					if child==0 & oneparincmissing!=1 & mother!=1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice girl pcollege parentalincome 		if child==0 & oneparincmissing!=1 & mother!=1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice girl pcollege parentalincome 	if child==0 & oneparincmissing!=1 & mother!=1 & pcollege!=., a(school) robust

eststo: areg sspec_Y1_imp pchoice girl 					if child==0 & oneparincmissing!=1 & mother==1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice girl pcollege parentalincome 		if child==0 & oneparincmissing!=1 & mother==1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice girl pcollege parentalincome 	if child==0 & oneparincmissing!=1 & mother==1 & pcollege!=., a(school) robust

esttab using "$Results/T_A16.csv", replace ///
	label nonumber keep(pbelief pself pchoice cchoice) r2 b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)

}

**********************
* Appendix Table A17 * 
**********************
{ 
use "$Data/admindata", clear   

eststo clear

eststo: areg sspec_Y1_imp pchoice cchoice pcollege parentalincome if child==0 & oneparincmissing!=1 & mother!=1 & girl==1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice pcollege parentalincome if child==0 & oneparincmissing!=1 & mother==1 & girl==1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice pcollege parentalincome if child==0 & oneparincmissing!=1 & mother!=1 & girl!=1 & pcollege!=., a(school) robust
eststo: areg sspec_Y1_imp pchoice cchoice pcollege parentalincome if child==0 & oneparincmissing!=1 & mother==1 & girl!=1 & pcollege!=., a(school) robust


esttab using "$Results/T_A17.csv", replace ///
	label nonumber keep(pbelief pself pchoice cchoice) r2 b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)
}

**********************
* Appendix Table A18 * 
**********************

{

use "$Data/experimentdata", clear
preserve
keep if child==1

pwcorr cchoice pself, sig
pwcorr cchoice pself if boy==1 & father==1, sig
pwcorr cchoice pself if boy==1 & father==0, sig
pwcorr cchoice pself if boy==0 & father==1, sig
pwcorr cchoice pself if boy==0 & father==0, sig

pwcorr cchoice pchoice, sig
pwcorr cchoice pchoice if boy==1 & father==1, sig
pwcorr cchoice pchoice if boy==1 & father==0, sig
pwcorr cchoice pchoice if boy==0 & father==1, sig
pwcorr cchoice pchoice if boy==0 & father==0, sig

pwcorr cchoice pbelief, sig
pwcorr cchoice pbelief if boy==1 & father==1, sig
pwcorr cchoice pbelief if boy==1 & father==0, sig
pwcorr cchoice pbelief if boy==0 & father==1, sig
pwcorr cchoice pbelief if boy==0 & father==0, sig

pwcorr cchoice cbelief, sig
pwcorr cchoice cbelief if boy==1 & father==1, sig
pwcorr cchoice cbelief if boy==1 & father==0, sig
pwcorr cchoice cbelief if boy==0 & father==1, sig
pwcorr cchoice cbelief if boy==0 & father==0, sig

pwcorr pchoice pbelief , sig
pwcorr pchoice pbelief  if boy==1 & father==1, sig
pwcorr pchoice pbelief  if boy==1 & father==0, sig
pwcorr pchoice pbelief  if boy==0 & father==1, sig
pwcorr pchoice pbelief  if boy==0 & father==0, sig

pwcorr pchoice cbelief , sig
pwcorr pchoice cbelief  if boy==1 & father==1, sig
pwcorr pchoice cbelief  if boy==1 & father==0, sig
pwcorr pchoice cbelief  if boy==0 & father==1, sig
pwcorr pchoice cbelief  if boy==0 & father==0, sig

pwcorr cbskill win , sig
pwcorr cbskill win  if boy==1 & father==1, sig
pwcorr cbskill win  if boy==1 & father==0, sig
pwcorr cbskill win  if boy==0 & father==1, sig
pwcorr cbskill win  if boy==0 & father==0, sig

pwcorr pbskill win , sig
pwcorr pbskill win  if boy==1 & father==1, sig
pwcorr pbskill win  if boy==1 & father==0, sig
pwcorr pbskill win  if boy==0 & father==1, sig
pwcorr pbskill win  if boy==0 & father==0, sig

pwcorr prisk crisk , sig
pwcorr prisk crisk  if boy==1 & father==1, sig
pwcorr prisk crisk  if boy==1 & father==0, sig
pwcorr prisk crisk  if boy==0 & father==1, sig
pwcorr prisk crisk  if boy==0 & father==0, sig

pwcorr prisk_q crisk_q , sig
pwcorr prisk_q crisk_q  if boy==1 & father==1, sig
pwcorr prisk_q crisk_q  if boy==1 & father==0, sig
pwcorr prisk_q crisk_q  if boy==0 & father==1, sig
pwcorr prisk_q crisk_q  if boy==0 & father==0, sig

pwcorr pcomp_s ccomp_s , sig
pwcorr pcomp_s ccomp_s  if boy==1 & father==1, sig
pwcorr pcomp_s ccomp_s  if boy==1 & father==0, sig
pwcorr pcomp_s ccomp_s  if boy==0 & father==1, sig
pwcorr pcomp_s ccomp_s  if boy==0 & father==0, sig

pwcorr psuc_h csuc , sig
pwcorr psuc_h csuc  if boy==1 & father==1, sig
pwcorr psuc_h csuc  if boy==1 & father==0, sig
pwcorr psuc_h csuc  if boy==0 & father==1, sig
pwcorr psuc_h csuc  if boy==0 & father==0, sig

pwcorr pdisc_p cdisc_p , sig
pwcorr pdisc_p cdisc_p  if boy==1 & father==1, sig
pwcorr pdisc_p cdisc_p  if boy==1 & father==0, sig
pwcorr pdisc_p cdisc_p  if boy==0 & father==1, sig
pwcorr pdisc_p cdisc_p  if boy==0 & father==0, sig

restore
}




*************
*************
** FIGURES **
*************
*************

**********************
* Appendix Figure A1 *
**********************
* Not Produced in Stata

**********************
* Appendix Figure A2 *
**********************
* Not Produced in Stata

**********************
* Appendix Figure A3 * 
**********************

use "$Data/experimentdata.dta", clear 

preserve
keep if child==1
gen t=_n
gen h=.
gen hd=.
gen ld=.

reg cbelief girl boy, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==1
replace h= b[1,2] if t==2	
replace hd=h+sqrt(v[1,1]) if t==1
replace ld=h-sqrt(v[1,1]) if t==1
replace hd=h+sqrt(v[2,2]) if t==2
replace ld=h- sqrt(v[2,2]) if t==2

reg pchoice girl boy, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==3
replace h= b[1,2] if t==4
replace hd=h+sqrt(v[1,1]) if t==3
replace ld=h-sqrt(v[1,1]) if t==3
replace hd=h+sqrt(v[2,2]) if t==4
replace ld=h- sqrt(v[2,2]) if t==4
	
local V child_beliefs_versus_choices
gen `V'=.
replace `V'=0.5 if t==1
replace `V'=2 if t==2
replace `V'=3.5 if t==3
replace `V'=5 if t==4
local xlabel xlabel( ///
0.5 "n=393" ///
2 "n=347" ///
3.5 "n=393" ///
5 "n=347" ///
,  notick )  
local legend  legend(order(1 "Girls" 2 "Boys"))
local title ytitle("Share choosing tournament pay")
local specs xtitle(" ") xtick(none) graphregion(color(white)) yscale(range(0 .6)) ylabel(0 (.1) .6) ytick(0 (.1) .6)
local text 	text(0.575 1.2 "Children's beliefs", size(medium)) ///
text(0.575 4.2 "Parents' choices", size(medium)) ///
text(0.53 1.2 "about parents' choices", size(medium)) ///
text(0.49 1.2 "p=0.91", size(medium)) ///
text(0.53 4.2 "p=0.02", size(medium)) ///			
text(0.475 2.7 "Diff-in-diff", size(medium)) ///
text(0.43 2.7 "p=0.09", size(medium)) 
local line xline(2.75, lpattern(dot)) 
local condition1  `V'==0.5 | `V'==3.5 
local condition2  `V'==2 | `V'==5  

graph twoway (bar h `V' if (`condition1'),fcolor(gs12) lcolor(gs0) lwidth(thin)) ///
(bar h `V' if (`condition2'),fcolor(gs6) lcolor(gs0) lwidth(thin)) ///
(rcap hd ld `V' if ((`condition1') | (`condition2') ), lcolor(gs0)), ///
`specs'  `legend' `title' `xlabel' `xscale' `text' `line'

restore


**********************
* Appendix Figure A4 * 
**********************

use "$Data/experimentdata.dta", clear 


preserve
keep if child==1
replace pbskill=pbskill-.25 if girl==1
replace pbskill=pbskill/10	
twoway (histogram pbskill if girl==1, width(.03) fcolor(gs12) lcolor(g0) lwidth(thin) discrete percent) ///
(histogram pbskill if girl==0, percent width(.03) fcolor(gs6) lcolor(g0) lwidth(thin)discrete), ///
graphregion(color(white)) xtitle("") legend(order(1 "Girls" 2 "Boys") rows(1)) ///
title("Parents", size(smallmedium))
graph save pbskillh.gph,  replace
graph export pbskillh.pdf,  replace
restore
	
preserve
keep if child==1
replace cbskill=cbskill-.25 if girl==1
replace cbskill=cbskill/10
twoway (histogram cbskill if girl==1, width(.03) fcolor(gs12) lcolor(g0) lwidth(thin) discrete percent) ///
(histogram cbskill if girl==0, percent width(.03) fcolor(gs6) lcolor(g0) lwidth(thin)discrete), ///
graphregion(color(white)) xtitle("") legend(order(1 "Girls" 2 "Boys") rows(1)) ///
title("Children", size(smallmedium))
graph save cbskillh.gph,  replace
graph export cbskillh.pdf,  replace
restore
	
preserve
keep if child==1
replace points3=points3-.25 if girl==1
twoway (histogram points3 if girl==1, width(.5) fcolor(gs12) lcolor(g0) lwidth(thin) discrete percent) ///
(histogram points3 if girl==0, percent width(.5) fcolor(gs6) lcolor(g0) lwidth(thin)discrete), ///
graphregion(color(white)) xtitle("") legend(order(1 "Girls" 2 "Boys") rows(1)) ///
xtitle("")  xscale(range(0 (2) 12)) ///
title("a) Performance of child", size(smallmedium))  
graph save performancehist.gph,  replace
graph export performancehist.pdf,  replace
restore
	
preserve
keep if child==1
replace win=win*10
replace win=win-.25 if girl==0
replace win=win/10
twoway (histogram win if girl==1, width(.05) fcolor(gs12) lcolor(g0) lwidth(thin) discrete percent) ///
(histogram win if girl==0, percent width(.05) fcolor(gs6) lcolor(g0) lwidth(thin)discrete), ///
graphregion(color(white)) xtitle("") legend(order(1 "Girls" 2 "Boys") rows(1)) ///
title("b) Simulated probability of winning for child", size(smallmedium))  
graph save winhist.gph,  replace
graph export winhist.pdf,  replace
restore

grc1leg performancehist.gph winhist.gph cbskillh.gph pbskillh.gph, row(2) ycommon  ///
 	graphregion(color(white)) legendfrom(pbskillh.gph)




**********************
* Appendix Figure A5 * 
**********************
use "$Data/experimentdata.dta", clear 


preserve		
keep if child==1
replace prisk=prisk+.25 if girl==0
replace prisk_q=prisk_q+.25 if girl==0
	
graph twoway 	(histogram prisk if girl==1, percent width(.5) fcolor(gs12) lcolor(gs0) lwidth(thin) discrete) ///
(histogram prisk if girl==0, width(.5) fcolor(gs6) lcolor(gs0) lwidth(thin) discrete percent) ///
, ///
graphregion(color(white)) xtitle("") legend(order(1 "Girls" 2 "Boys") rows(1)) ///
xlabel(1 "Least risk "  5 "Most risk" ) title("c) Parent lottery choice for child ", size(medium) color(gs0)) 
graph save riskparent.gph,  replace


graph twoway 	(histogram prisk_q if girl==1, percent width(.5) fcolor(gs12) lcolor(gs0) lwidth(thin) discrete) ///
(histogram prisk_q if girl==0, width(.5) fcolor(gs6) lcolor(gs0) lwidth(thin) discrete percent) ///
, ///
graphregion(color(white)) xtitle("") legend(order(1 "Girls" 2 "Boys") rows(1)) ///
xlabel(0 "Least risk "  10 "Most risk" )  ///
title("d) Parent self-assessment:" "willingness to take risk for child", size(medium)   color(gs0)) 
graph save risk_qparent.gph,  replace

replace crisk=crisk+.25 if girl==0
replace crisk_q=crisk_q+.25 if girl==0
	
graph twoway (histogram crisk if girl==1, percent width(.5) fcolor(gs12) lcolor(gs0) lwidth(thin) discrete) ///
(histogram crisk if girl==0, width(.5) fcolor(gs6) lcolor(gs0) lwidth(thin) discrete percent) ///
, ///
graphregion(color(white)) xtitle("") legend(order(1 "Girls" 2 "Boys") rows(1)) ///
xlabel(1 "Least risk "  5 "Most risk" )  ///
title("a) Child lottery choice for self",  size(medium)  color(gs0)) 
graph save riskchild.gph,  replace
	
graph twoway (histogram crisk_q if girl==1, percent width(.5) fcolor(gs12) lcolor(gs0) lwidth(thin) discrete) ///
(histogram crisk_q if girl==0, width(.5) fcolor(gs6) lcolor(gs0) lwidth(thin) discrete percent) ///
, ///
graphregion(color(white)) xtitle("") legend(order(1 "Girls" 2 "Boys") rows(1)) ///
xlabel(0 "Least risk "  10 "Most risk" )  ///
title("b) Child self-assessment:" "willingness to take risk", size(medium)  color(gs0)) 
graph save risk_qchild.gph,  replace

grc1leg riskchild.gph risk_qchild.gph riskparent.gph risk_qparent.gph, ycommon row(2) graphregion(color(white)) 
restore
	

**********************
* Appendix Figure A6 * 
**********************
use "$Data/experimentdata.dta", clear 


preserve
keep if child==1
gen t=_n
gen h=.
gen hd=.
gen ld=.

reg cchoice girl boy if foreign==1, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==1
replace h= b[1,2] if t==2	
replace hd=h+sqrt(v[1,1]) if t==1
replace ld=h-sqrt(v[1,1]) if t==1
replace hd=h+sqrt(v[2,2]) if t==2
replace ld=h- sqrt(v[2,2]) if t==2

reg cchoice girl boy if foreign==0, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==3
replace h= b[1,2] if t==4
replace hd=h+sqrt(v[1,1]) if t==3
replace ld=h-sqrt(v[1,1]) if t==3
replace hd=h+sqrt(v[2,2]) if t==4
replace ld=h- sqrt(v[2,2]) if t==4
	
reg cchoice girl boy if cbrokenh==1, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==11
replace h= b[1,2] if t==21	
replace hd=h+sqrt(v[1,1]) if t==11
replace ld=h-sqrt(v[1,1]) if t==11
replace hd=h+sqrt(v[2,2]) if t==21
replace ld=h- sqrt(v[2,2]) if t==21

reg cchoice girl boy if cbrokenh==0, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==31
replace h= b[1,2] if t==41
replace hd=h+sqrt(v[1,1]) if t==31
replace ld=h-sqrt(v[1,1]) if t==31
replace hd=h+sqrt(v[2,2]) if t==41
replace ld=h- sqrt(v[2,2]) if t==41
	
local V Appendix_figure_6_A
gen `V'=.
replace `V'=0.5 if t==1
replace `V'=2 if t==2
replace `V'=3.5 if t==3
replace `V'=5 if t==4
replace `V'=6.5 if t==11
replace `V'=8 if t==21
replace `V'=9.5 if t==31
replace `V'=11 if t==41
local xlabel xlabel( ///
0.5 "n=55" ///
2 "n=52" ///
3.5 "n=338" ///
5 "n=296" ///
6.5 "n=282" ///
8 "n=238" ///
9.5 "n=111" ///
11 "n=109" ///
,  notick )  
local legend  legend(order(1 "Girls" 2 "Boys"))
local title ytitle("Share choosing tournament pay")
local specs xtitle(" ") xtick(none) graphregion(color(white)) yscale(range(0 1)) ylabel(0 (.1) 1) ytick(0 (.1) 1)
local text text(0.85 1.2 "Yes", size(medium)) ///
text(0.85 4.2 "No", size(medium)) ///
text(0.85 7.2 "Yes", size(medium)) ///
text(0.85 10.2 "No", size(medium)) ///
text(0.98 2.7 "Speak foreign language at home", size(medium)) ///
text(0.98 8.7 "Parents live together", size(medium)) 
local line xline(2.75, lpattern(dot)) xline(5.75, lpattern(solid)) xline(8.75, lpattern(dot)) 
local condition1  `V'==0.5 | `V'==3.5 | `V'==6.5 | `V'==9.5
local condition2  `V'==2 | `V'==5  | `V'==8 | `V'==11
graph twoway (bar h `V' if (`condition1'),fcolor(gs12) lcolor(gs0) lwidth(thin)) ///
(bar h `V' if (`condition2'),fcolor(gs6) lcolor(gs0) lwidth(thin)) ///
(rcap hd ld `V' if ((`condition1') | (`condition2') ), lcolor(gs0)), ///
`specs'  `legend' `title' `xlabel'  `xscale' `text' `line'

restore




preserve
keep if child==1
gen t=_n
gen h=.
gen hd=.
gen ld=.

reg pchoice girl boy if foreign==1, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==1
replace h= b[1,2] if t==2	
replace hd=h+sqrt(v[1,1]) if t==1
replace ld=h-sqrt(v[1,1]) if t==1
replace hd=h+sqrt(v[2,2]) if t==2
replace ld=h- sqrt(v[2,2]) if t==2

reg pchoice girl boy if foreign==0, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==3
replace h= b[1,2] if t==4
replace hd=h+sqrt(v[1,1]) if t==3
replace ld=h-sqrt(v[1,1]) if t==3
replace hd=h+sqrt(v[2,2]) if t==4
replace ld=h- sqrt(v[2,2]) if t==4

reg pchoice girl boy if cbrokenh==1, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==11
replace h= b[1,2] if t==21	
replace hd=h+sqrt(v[1,1]) if t==11
replace ld=h-sqrt(v[1,1]) if t==11
replace hd=h+sqrt(v[2,2]) if t==21
replace ld=h- sqrt(v[2,2]) if t==21

reg pchoice girl boy if cbrokenh==0, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==31
replace h= b[1,2] if t==41
replace hd=h+sqrt(v[1,1]) if t==31
replace ld=h-sqrt(v[1,1]) if t==31
replace hd=h+sqrt(v[2,2]) if t==41
replace ld=h- sqrt(v[2,2]) if t==41
	
local V Appendix_figure_6_B
gen `V'=.
replace `V'=0.5 if t==1
replace `V'=2 if t==2
replace `V'=3.5 if t==3
replace `V'=5 if t==4
replace `V'=6.5 if t==11
replace `V'=8 if t==21
replace `V'=9.5 if t==31
replace `V'=11 if t==41
local xlabel xlabel( ///
0.5 "n=55" ///
2 "n=52" ///
3.5 "n=338" ///
5 "n=296" ///
6.5 "n=282" ///
8 "n=238" ///
9.5 "n=111" ///
11 "n=109" ///
,  notick )  
local legend  legend(order(1 "Girls" 2 "Boys"))
local title ytitle("Share choosing tournament pay")
local specs xtitle(" ") xtick(none) graphregion(color(white)) yscale(range(0 1)) ylabel(0 (.1) 1) ytick(0 (.1) 1)
local text 	text(0.85 1.2 "Yes", size(medium)) ///
text(0.85 4.2 "No", size(medium)) ///
text(0.85 7.2 "Yes", size(medium)) ///
text(0.85 10.2 "No", size(medium)) ///
text(0.98 2.7 "Speak foreign language at home", size(medium)) ///
text(0.98 8.7 "Parents live together", size(medium)) 
local line xline(2.75, lpattern(dot)) xline(5.75, lpattern(solid)) xline(8.75, lpattern(dot)) 
local condition1  `V'==0.5 | `V'==3.5 | `V'==6.5 | `V'==9.5
local condition2  `V'==2 | `V'==5  | `V'==8 | `V'==11
graph twoway (bar h `V' if (`condition1'),fcolor(gs12) lcolor(gs0) lwidth(thin)) ///
(bar h `V' if (`condition2'),fcolor(gs6) lcolor(gs0) lwidth(thin)) ///
(rcap hd ld `V' if ((`condition1') | (`condition2') ), lcolor(gs0)), ///
`specs'  `legend' `title' `xlabel' `xscale' `text' `line'
restore


**********************
* Appendix Figure A7 * 
**********************

preserve
clear

*Niederle  and Vesterlund 2007	 
set obs 80
gen id=_n
gen boy=0
replace boy=1 if id<41
gen compete=0
replace compete=1 if id<30
replace compete=1 if id>67

collapse (mean) mcompete= compete (sd) sdcompete=compete (count) n=compete, by(boy) 
generate highcompete = mcompete + (sdcompete / sqrt(n))
generate lowcompete = mcompete - (sdcompete / sqrt(n))	
gen t=0
replace t=1 if boy==1
save Figure_lit_comparison, replace

*Buser et al. (2014)
clear 
set obs 362
gen id=_n
gen boy=0
replace boy=1 if id<178
gen compete=0
replace compete=1 if id<88
replace compete=1 if id>318


collapse (mean) mcompete= compete (sd) sdcompete=compete (count) n=compete, by(boy) 
generate highcompete = mcompete + (sdcompete / sqrt(n))
generate lowcompete = mcompete - (sdcompete / sqrt(n))
gen t=2.5
replace t=3.5 if boy==1
append using 	Figure_lit_comparison
save Figure_lit_comparison, replace

*AlmÂs et al.(2017)
clear 
set obs 422
gen id=_n
gen boy=0
replace boy=1 if id<171
gen compete=0
replace compete=1 if id<73
replace compete=1 if id>371

collapse (mean) mcompete= compete (sd) sdcompete=compete (count) n=compete, by(boy) 
generate highcompete = mcompete + (sdcompete / sqrt(n))
generate lowcompete = mcompete - (sdcompete / sqrt(n))
gen t=5
replace t=6 if boy==1
append using 	Figure_lit_comparison
save Figure_lit_comparison, replace

*Sutter and Gl‰tzle R¸tzler (2015)
clear 
set obs 483
gen id=_n
gen boy=0
replace boy=1 if id<251
gen compete=0
replace compete=1 if id<139
replace compete=1 if id>407


collapse (mean) mcompete= compete (sd) sdcompete=compete (count) n=compete, by(boy) 
generate highcompete = mcompete + (sdcompete / sqrt(n))
generate lowcompete = mcompete - (sdcompete / sqrt(n))
gen t=7.5
replace t=8.5 if boy==1
append using 	Figure_lit_comparison
save Figure_lit_comparison, replace


*Buser et al. (2017)
clear
set obs 1514
gen id=_n
gen boy=0
replace boy=1 if id<761
gen compete=0
replace compete=1 if id<422
replace compete=1 if id>1198


collapse (mean) mcompete= compete (sd) sdcompete=compete (count) n=compete, by(boy) 
generate highcompete = mcompete + (sdcompete / sqrt(n))
generate lowcompete = mcompete - (sdcompete / sqrt(n))
gen t=10
replace t=11 if boy==1
append using 	Figure_lit_comparison
save Figure_lit_comparison, replace

*This study
clear
set obs 740
gen id=_n
gen boy=0
replace boy=1 if id<348
gen compete=0
replace compete=1 if id<118
replace compete=1 if id>667


collapse (mean) mcompete= compete (sd) sdcompete=compete (count) n=compete, by(boy) 
generate highcompete = mcompete + (sdcompete / sqrt(n))
generate lowcompete = mcompete - (sdcompete / sqrt(n))
gen t=12.5
replace t=13.5 if boy==1
append using 	Figure_lit_comparison
save Figure_lit_comparison, replace


graph twoway ///
	(bar mcompete t if (t==0 | t==2.5 | t==5 | t==7.5 | t==10), color(gs12) lcolor(black)  lwidth(thin)) ///
	(bar mcompete t if (t==1 | t==3.5 | t==6 | t==8.5 | t==11), color(gs6) lcolor(black)  lwidth(thin)) ///
	(bar mcompete t if  t==12.5, fcolor(gs12) lcolor(cranberry) lwidth(thick)) ///
	(bar mcompete t if  t==13.5, fcolor(gs6) lcolor(cranberry) lwidth(thick)) ///
	(rcap highcompete lowcompete t, lcolor(g0)), ///
	legend(order(1 "Girls" 2 "Boys")) ///
	yscale(range(0 .6)) ylabel(0 (.1) 1) ytick(0 (.1) 1) ///
	xtitle("")  xtick(none) ///
	xscale(range(0 9)) ///
	xlabel(0.5 `""Niederle &" "Vesterlund (2007)" "(n=80)""' 3 `""Buser et" "al.(2014)" "(n=362)""' ///
	5.5 `""Sutter & Gl‰tzle" "-R¸tzler (2015)" "(n=422*)" "' ///
	8 `""AlmÂs et" " al.(2017)" "(n=483)""' ///
	10.5`""Buser et" " al.(2017)" "(n=1514)""' 13 `""This study" "(n=740)""', labsize(small)) ///
	ytitle(Share choosing tournament pay) ///
	xscale(range(0 4)) graphregion(color(white)) xline(1.75, lpattern(dash) lcolor(gs8)) ///
	text(0.95 0.5 "College sample", size(small)) text(0.95 8 "Secondary school and high school sample", size(small)) 
graph export Figure_A7.pdf, replace

restore


**********************
* Appendix Figure A8 * 
**********************
use "$Data/experimentdata.dta", clear 

preserve 
keep if child==1
replace pbcertainty=pbcertainty/.2

histogram pbcertainty if boy==1, title("Boys", color(gs0)) discrete fcolor(gs6) lcolor(g0) xtick(none) graphregion(color(white)) ///
xtitle("Child will choose tournament pay (%)") ylabel(0 (.01) .04) ytick(0 (.01) .04)
graph save belief1.gph,  replace

histogram pbcertainty if girl==1, title("Girls", color(gs0)) discrete fcolor(gs12) lcolor(g0) xtick(none) graphregion(color(white)) ///
xtitle("Child will choose tournament pay (%)") ylabel(0 (.01) .04) ytick(0 (.01) .04)
graph save belief2.gph,  replace
		
graph combine belief2.gph belief1.gph, ycommon row(1) graphregion(color(white)) 
restore


**********************
* Appendix Figure A9 * 
**********************
use "$Data/experimentdata.dta", clear 

preserve
keep if child==1 
gen t=_n
gen h=.
gen hd=.
gen ld=.	
	
reg pchoice girl boy if mother==1, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==1
replace h= b[1,2] if t==2	
replace hd=h+sqrt(v[1,1]) if t==1
replace ld=h-sqrt(v[1,1]) if t==1
replace hd=h+sqrt(v[2,2]) if t==2
replace ld=h- sqrt(v[2,2]) if t==2

reg pchoice girl boy if mother==0, r nocons
mat b = e(b)
mat v= e(V)
replace h= b[1,1] if t==3
replace h= b[1,2] if t==4
replace hd=h+sqrt(v[1,1]) if t==3
replace ld=h-sqrt(v[1,1]) if t==3
replace hd=h+sqrt(v[2,2]) if t==4
replace ld=h- sqrt(v[2,2]) if t==4
	
local V Appendix_figure_9_var
gen `V'=.
replace `V'=0.5 if t==1
replace `V'=2 if t==2
replace `V'=3.5 if t==3
replace `V'=5 if t==4
local xlabel xlabel( ///
0.5 `""n=238"' ///
2 `""n=188"' ///
3.5 `""n=155"' ///
5 `""n=159"' ///
,  notick )  
local legend  legend(off)
local title ytitle(" ")
local specs xtitle(" ") xtick(none) graphregion(color(white)) yscale(range(0 .6)) ylabel(0 (.1) .6) ytick(0 (.1) .6)
local text text(0.575 1.2 "Mothers", size(medium)) ///
text(0.575 4.2 "Fathers", size(medium)) ////
text(0.53 1.2 "p=0.045", size(medium)) ///
text(0.53 4.2 "p=0.375", size(medium)) 
local line xline(2.75, lpattern(dot)) 

local condition1  `V'==0.5 | `V'==3.5 
local condition2  `V'==2  | `V'==5 
graph twoway (bar h `V' if (`condition1'),fcolor(gs12) lcolor(gs0) lwidth(thin)) ///
(bar h `V' if (`condition2'),fcolor(gs6) lcolor(gs0) lwidth(thin)) ///
(rcap hd ld `V' if ((`condition1') | (`condition2') ), lcolor(gs0)), ///
`specs'  `legend' `title' `xlabel' `xscale' `text' `line'
restore



* END OF DOFILE *
